package ddd1;

public class work3 {
    public static void main(String[] args) {
        String s1 = "abccba";
        System.out.println(isHuiWen(s1));
    }
    public static boolean isHuiWen(String wen) {
        if (wen.length() == 1) {
            return true;
        }
        else if (wen.length() > 1) {
            int index = wen.length() / 2;
            for (int i = 0; i < index; i++) {
                if (wen.charAt(i) != wen.charAt(wen.length() - i - 1)) {
                    return false;
                }
            }
            return true;
        }
        return false;
    }
}
